|
|
|
BlueCielo Meridian Enterprise 2013 Developer's Guide | BlueCielo ECM Solutions |
Instead of setting the behavior and appearance of controls in SetEditMode with the EnableControl method, you can use the Visual Basic control properties to disable the controls as in the following examples.
ammAudit_BSTR.Locked = True ammAudit_BSTR.BackColor = vbButtonFace
When EditMode is False, the Locked property of the control should be set to True, and the background color property set accordingly. In the example, it is set to the same color as a button face (which is controlled by the user’s desktop appearance settings in Windows), so it is obvious to the user that this control cannot be edited.
When EditMode is True, the Locked property should be set to False, and the background color returned to normal. In this example, it is set to the default Windows application background color to show that the property can be edited.
ammAudit_BSTR.Locked = False ammAudit_BSTR.BackColor = vbWindowBackground
Whether a control should be enabled for editing can be determined using the CanEditProperty method, but all controls should be read-only when SetEditMode is called with the PPEM_READONLY parameter.
Example
Private Sub IAMExtensionPage_SetEditMode(ByVal EditMode As PPEDITMODES)
On Error GoTo error_handler
Dim bReadOnly As Boolean
bReadOnly = (EditMode = PPEM_READONLY)
If Not m_Designer Is Nothing Then
' Set the edit mode of the datasource
m_Designer.SetEditMode Me, EditMode, False
' Let the designer enable/disable the Drawing Number control
Call m_Designer.EnableControl(ammDrawingNumber_BSTR)
' Enable/disable the Drawing Audit control using the control properties
If bReadOnly Or Not m_Designer.CanEditProperty("PSDrawingProperties", "Audit_BSTR") Then
ammAudit_BSTR.Locked = True
ammAudit_BSTR.BackColor = vbButtonFace
Else
ammAudit_BSTR.Locked = False
ammAudit_BSTR.BackColor = vbWindowBackground
End If
End If
Exit Sub
error_handler:
MsgBox Caption & " SetEditMode: " & Err.Description
End Sub
Related information
Setting the edit mode using the EnableControl method
Copyright © 2000-2013 BlueCielo ECM Solutions |